<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
  <script language="javascript" src="./Lodop6.161/LodopFuncs.js"></script>
    <script src="../jquery-3.6.0.min.js"></script>
    <script src="../dist_JsBarcode.all.min.js"></script>
    <script src="../qrcode/qrcode.min.js"></script>
  <style lang="scss" rel="stylesheet/scss" scoped>
      #tableData{
        width: 1007px;
          margin: 0 auto;
      }

    .dtitile{}
    .butdiv{
      margin-top: 50px;text-align: center;
  }
    .button1{
      color: #fff;
      background-color: #1890ff;
      border-color: #1890ff;
      text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
      -webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
      box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);height: 32px;padding: 0 15px;font-size: 14px;border-radius: 4px;
    }
    .foots{
      border-top: #000e1f dashed 1px;margin-bottom: 10px;margin-left: 0px;height: auto;text-indent: 26px;font-size: 13px;
    }
  </style>
  <script>
    function batchPrint(){


      showPrint();
    }
    function current() {
      var d = new Date(),
        str = '';
      str += d.getFullYear() + '-'; //获取当前年份
      str += d.getMonth() + 1 + '-'; //获取当前月份（0——11）
      str += d.getDate() + ' ';

      return str;
    }
    function currenttime() {
      var d = new Date(),
        str = '';
      str += d.getHours() + ':';
      str += d.getMinutes() + ':';
      str += d.getSeconds() ;
      return str;
    }
    window.onload = function() {
        makeCode("122222222");
      var reg = new RegExp("(^|&)waterId=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);
      if (r != null)
      var   waterid = unescape(r[2]);
        console.log(waterid)
      document.getElementById("waterId").value=waterid;
      var prints = window.sessionStorage.getItem("print"+waterid);
      var fapiaoInfo = JSON.parse(prints);
        console.log(fapiaoInfo);
        console.log(fapiaoInfo.name);
        var sex = fapiaoInfo.sex;
        if(sex==0){
            sex='男';
        }else if(sex==1){
            sex=='女';
        }
        document.getElementById("baogaoName").innerHTML=fapiaoInfo.name;
        document.getElementById("baogaoSex").innerHTML=sex;
        document.getElementById("baogaoAge").innerHTML=fapiaoInfo.age;
        document.getElementById("baogaoIdcard").innerHTML=fapiaoInfo.idcard;
        document.getElementById("baogaoSignDate").innerHTML=fapiaoInfo.createTime;
        document.getElementById("baogaoSignDate2").innerHTML=fapiaoInfo.returnDate;
        document.getElementById("baogaoProject").innerHTML=fapiaoInfo.project;
        document.getElementById("baogaoResult").innerHTML=fapiaoInfo.projectResult;

    }


  </script>
</head>
<body>
    <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0" height="0">
      <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="./Lodop6.161/install_lodop32.exe"></embed>
    </object>
      <div id="tableData">
          <div style="font-size: 12pt;width:1007px;">
          <div style="width:1007px;margin-left:15%;font-size:20pt;font-weight:900;margin-top:50px;">山东大学附属儿童医院&nbsp;&nbsp;&nbsp;&nbsp;济南市儿童医院</div>
          <div><span style="font-size:20pt;font-weight:900;margin-left:35%;margin-top:7px;"> 检&nbsp;验&nbsp;报&nbsp;告&nbsp;单</span><span
                  style="float:right;font-size:13pt;font-weight:bold;margin-top:10px;">质评合格 全省参考</span></div>
              <div id="qrcode" style="width: 100px;height: 100px;position: absolute;left: 999px;top: 45px;"></div>
          <div style="margin-top:43px;font-size: 12pt"><span> 姓名:</span><span id="baogaoName"></span><span
                  style="margin-left:50px;"> 性别:</span><span id="baogaoSex"></span><span style="margin-left:49px;"> 年龄:</span><span  id="baogaoAge"></span><span
                  style="margin-left:52px;"> 标本类型:</span>
              <span>咽拭子</span><span style="margin-left:50px;"> 身份证号:</span><span  id="baogaoIdcard"></span></div>
          <div style="border-bottom: #000000 1px solid;width: 100%;height: 9px;margin-top:-3pt;"></div>
          <div style="margin-top:12px;display:inline-block;width:1007px;font-weight: bold;"><span> 序</span><span
                  style="margin-left:7%">代号</span><span style="margin-left:8%"> 项目名称</span>
              <span style="margin-left:11%">结果</span><span style="margin-left:11%">
			参考范围</span><span style="margin-left:9%">单位</span></div>
          <div style="border-bottom: #000000 1px solid;width: 100%;height: 9px;margin-top:-5pt;"></div>
          <div style="height:180px;">
              <div style="margin-top:15px;display:inline-block;width:1007px;"><span> 1</span><span
                      style="margin-left:6%">2019-nCov</span><span style="margin-left:4%" id="baogaoProject"> </span>
                  <span style="margin-left:4%" id="baogaoResult"></span><span style="margin-left:12%">
			阴性</span><span style="margin-left:10%"></span></div>
          </div>
          <div style="border-bottom: #000000 1px solid;width: 100%;height: 14px;"></div>
          <div style="margin-top:15px;"><span class="stl_26 stl_08 stl_29" style="word-spacing:0.3692em;">接收时间：</span><span id="baogaoSignDate"> &nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;<span>报告时间：</span><span id="baogaoSignDate2"> &nbsp;</span>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>检验者：张豪正&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;审核者: 刘毅</span>
          </div>

          <div style="margin-top:15px;"><span>本检测报告可能受到采样时间、采样部位及方法学局限性等因素的影响，结果需结合临床进行分析。</span> </div>
          <div style="margin-top:15px;"><span>本报告仅对本次检测标本负责。 &nbsp;</span></div>
      </div>
      </div>
    <div class="butdiv"><input type="hidden" id="waterId" value="">  <input type="button" class="button1" value="打印" onclick="batchPrint()"></div>

</body>

<script language="javascript" type="text/javascript">
    var qrcode = new QRCode(document.getElementById("qrcode"), {
        width : 100,
        height : 100
    });
    function makeCode (elText) {

        if (!elText) {

            return;
        }

        qrcode.makeCode(elText);
    }
  var LODOP; //声明为全局变量
  function CreatePrintPage(tableTitle,domId) {
    LODOP.ADD_PRINT_TEXT(21,300,600,30,tableTitle+"\n");//LODOP.ADD_PRINT_TEXT(21,300,151,30,"标题\n");
    LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
    LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
    LODOP.SET_PRINT_STYLEA(0,"Horient",2);
    LODOP.ADD_PRINT_TABLE("2%","1%","96%","98%",document.getElementById(domId).innerHTML);
  };
  function CreatePage(){
      var strBodyStyle = "<style> </style>";
      var strStyleCSS = "";
      var tabledataheml = document.getElementById("tableData").innerHTML;
      var strDataHtml = strStyleCSS + strBodyStyle + "<body style='margin-left:10%;font-size：100%'>" + tabledataheml + "</body>";
    // console.log(strDataHtml);
    //LODOP.ADD_PRINT_TABLE("2%","1%","96%","98%",strDataHtml);
    //LODOP.ADD_PRINT_HTM("2%","1%","96%","98%",strDataHtml);
    //LODOP.ADD_PRINT_HTM("0","1%","98%","BottomMargin:15mm",strDataHtml);
      LODOP.ADD_PRINT_HTML("1", "0", "96%", "99%", strDataHtml);
      LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "Auto-Width");
  }
  function showPrint(){
    LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
    LODOP.PRINT_INIT("预约信息");
    //LODOP.SET_PRINTER_INDEX("DASCOM DT-330");//指定某虚拟打印机"DASCOM DT-330");
    CreatePage();
     //LODOP.PREVIEW();	//打印预览
    LODOP.PRINT();	//直接打印
    window.parent.close();
  }
</script>
</html>
